// This is a manifest file that'll be compiled into application.js, which will include all the files
// listed below.
//
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
//
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
// compiled file.
//
// Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details
// about supported directives.
//
//= require jquery
//= require jquery_ujs
//= require turbolinks
//= require_tree .
function isTextNull(obj_str) {
	var obj_str = obj_str;
	var str = obj_str.replace(/[ ]/g, "");
	if (str == "") {
		return true;
	} else {
		return false;
	}
}
//========== 匹配邮箱 =========
function CheckEmail(email) {
	var reg = /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+((\.[a-zA-Z0-9_-]{2,3}){1,2})$/;
	return reg.test(email);
}
//警告提示弹出框
function message_alert(warning_content, msg_type, body) {
	var msg_div = $("<div class='backdrop' id='msg'></div>");
	if (msg_type == "err") {
		msg_div.append("<div class='alert alert-danger warning_alert message_alert_posation'>" + warning_content + "</div>");
	} else {
		msg_div.append("<div class='alert alert-success warning_alert message_alert_posation'>" + warning_content + "</div>");
	}
	if(body == null){
		body = "body";
	}else{
		body = "#"+body;
	}

	$(body).append(msg_div);
	msg_div.fadeIn(500);
	msg_div.fadeOut(2000);
	setTimeout(function() {
		var msg_alert = document.getElementById("msg");
		document.body.removeChild(msg_alert);
	}, 5000);

}